package com.codeduck.kafka.event.message;

import org.springframework.context.ApplicationEvent;

/**
 * 消费者消息事件类，通过ApplicationContext进行事件的发布
 */
public class MessageEvent extends ApplicationEvent {

    private MessageInfo messageInfo;


    /**
     * Create a new {@code ApplicationEvent}.
     *
     * @param source the object on which the event initially occurred or with
     *               which the event is associated (never {@code null})
     */
    public MessageEvent(Object source, MessageInfo messageInfo) {
        super(source);
        this.messageInfo = messageInfo;
    }

    public MessageInfo getMessageInfo() {
        return messageInfo;
    }

    public void setMessageInfo(MessageInfo messageInfo) {
        this.messageInfo = messageInfo;
    }
}
